package com.efuture.chapterfour

/* @Description:Kotlin语言初始化陷进2
 * @Auther: zhaoshanshan
 * @Date: 2022/03/06/11:47 下午
 */
class Demo74 {
    val info: String
    init {
        info = "hello"//该行代码一定要写在调用者前面 不然会抛出异常
        println(getInfoFirstChar())
    }

    private fun getInfoFirstChar():String {
        return "${info[0]}"
    }


}

fun main() {
    Demo74();
}